package com.fjwt.gz.proxy.ctrl.score.stat;


import com.alibaba.fastjson2.JSONObject;
import com.fjwt.gz.core.model.ApiRes;
import com.fjwt.gz.proxy.ctrl.CommonCtrl;
import com.fjwt.gz.service.impl.StatScoreNumDayService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 统计积分总情况变化和变化接口
 *
 * @author myf
 */
@RestController
@RequestMapping("/api/statScoreNumDay")
@Slf4j
public class StatScoreNumDayController extends CommonCtrl {

    @Autowired
    private StatScoreNumDayService statScoreNumDayService;

    /**
     * 首页积分统计
     * @return
     */
    @PostMapping("/getDayScoreStatistics")
    public ApiRes getDayScoreStatistics() {
        String currentAgentNo = getCurrentAgentNo();
        JSONObject result = statScoreNumDayService.getDayScoreStatistics(currentAgentNo);
        return ApiRes.ok(result);
    }
}
